﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MySql.Data.MySqlClient;

namespace ProntuarioEletronico.Banco
{
    public class ConexaoMysql
    {
        public string conexaoMySQL;
        public MySqlConnection conn = null;

        public ConexaoMysql()
        {
            //conexaoMySQL = "server=localhost; uid=root; password='123456' database=Prontuario_Eletronico;  ";
            string server = "localhost";
            string database = "Prontuario_Eletronico";
            string uid = "root";
            string password = "123456";

            conexaoMySQL = "SERVER=" + server + ";" + "DATABASE=" +
            database + ";" + "UID=" + uid + ";";
            Open();
        }

    
        public void Open()
        {
            if (conn != null)
            {
                conn.Open();
            }
            else
            {
                conn = new MySqlConnection(conexaoMySQL);
                conn.Open();
            }
        }

    }
}